//
//  ATWLoginMetaData.m
//  WorkplusIM-IOS
//
//  Created by lingen on 15/10/8.
//  Copyright © 2015年 lingen.liu. All rights reserved.
//

#import "ATWLoginMetaData.h"
#import <AdSupport/ASIdentifierManager.h>
#import "ATWUtil.h"

/**
 *登录信息元数据
 */
@implementation ATWLoginMetaData

-(instancetype)initLoginMetaData:(NSString *)clientId secret:(NSString *)clientSecret deviceId:(NSString *)deviceId tenantId:(NSString *)tenantId{
    if (self = [super init]) {
        self.tenantId = tenantId;
        self.clientId = clientId;
        self.clientSecret = clientSecret;
        self.deviceId = deviceId;
    }
    return self;
}

-(instancetype)initLoginMetaData:(NSString *)clientId secret:(NSString *)clientSecret tenantId:(NSString *)tenantId{
    NSString *deviceId = [self p_deviceId];
    return [self initLoginMetaData:clientId secret:clientSecret deviceId:deviceId tenantId:tenantId];
}

- (NSString *)p_deviceId {
    return [ASIdentifierManager sharedManager].advertisingIdentifier.UUIDString;
}

-(void)login:(LoginBlock)result{
//    NSDictionary *params = @{@"grant_type": @"password",
//                             @"scope" : @"user",
//                             @"tenant_id" : self.tenantId,
//                             @"client_id" : self.clientId,
//                             @"client_secret" : self.clientSecret,
//                             @"device_id" : self.deviceId,
//                             @"device_platform" : @"IOS"};
//    
//    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
}

-(void)endpoing:(ATWAuth *)auth result:(EndpoingBlock)endpoingBlock{
    
}

@end
